function [quality, neuronOutputs, neuronInputs] = predictQuality(weights, inputs)

m = size(inputs, 2);
numLayers = length(weights);
onesM = ones(1, m);

neuronOutputs = cell(numLayers + 1, 1);
neuronInputs = cell(numLayers + 1, 1);

neuronOutputs{1} = [onesM; inputs];
neuronInputs{1} = inputs;

for i = 2 : (numLayers + 1)
    neuronInputs{i} = weights{i - 1} * neuronOutputs{i - 1};
    neuronOutputs{i} = [onesM; tanh(neuronInputs{i})];
end

quality = neuronOutputs{end}(2 : end, :);
